<html>
<head>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>都市信息网</title>
    <link type="text/css" rel="stylesheet" href="/css/style.css">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <script src="/js/page.js"></script>
</head>
<body background="/images/back.gif">
<center>
    <table border="0" width="920" cellspacing="0" cellpadding="0" bgcolor="white">
        <tr><td colspan="2">
            <!-- 页眉 -->
            <iframe src="/view/top.html" frameBorder="0" width="920" scrolling="no" height="200" ></iframe>
        </td></tr>
        <tr>
            <td width="230" valign="top" align="center">
                <!-- 左侧 -->
                <iframe id="searchPage" src="/view/left.html" frameBorder="0" width="225" scrolling="no" height="400" ></iframe>
            </td>
            <td width="690" height="400" align="center" valign="top" bgcolor="#FFFFFF">
                <table border="0" width="670" cellspacing="0" cellpadding="0" style="margin-top:5">

                    <tr height="30"><td style="text-indent:5" valign="bottom"><font color="#004790"><b>■查询结果</b></td></tr>
                    <tr height="1"><td></td></tr>
                    <tr>
                        <td align="center" style="border:1 solid">
                            <table class="table" id="searchResult" border="0" width="100%" rules="rows" cellspacing="0">
                                <thead  class="thead-dark">
                                    <tr align="center" height="30" bgcolor="#F0F0F0">
                                        <td width="6%"><b>序号</b></td>
                                        <td width="11%"><b>信息类别</b></td>
                                        <td width="8%"><b>ID值</b></td>
                                        <td width="38%"><b>信息标题</b></td>
                                        <td width="22%"><b>发布时间</b></td>
                                        <td width="15%"><b>联系人</b></td>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <tr height="1"><td></td></tr>
                    <tr height="30"><td align="center">


                        <html>
                        <head><title>分页导航栏</title></head>
                        <body>

                        <table border="0" width="100%" cellspacing="0">
                            <tr>
                                <!--显示分页的信息-->
                                <div class="row">
                                    <!--分页文字信息-->
                                    <div class="col-md-6" align="left" id="page_info_area">
                                    </div>
                                    <!--分页条信息-->
                                    <div class="col-md-6" align="right" id="page_nav_area">
                                    </div>
                                </div>
                                <!--<td width="60%"><table border='0' cellpadding='3'><tr><td>每页显示：8/22 条记录！当前页：1/3 页！</td></tr></table></td>
                                <td align="center" width="40%">
                                    <table border='0' cellpadding='3'><tr>
                                        <td>
                                            <a href='info_SearchShow.action?searchInfo.subsql=info_phone&searchInfo.sqlvalue=1&searchInfo.type=like&showType=link&showpage=2'>下一页</a>&nbsp;
                                            <a href='info_SearchShow.action?searchInfo.subsql=info_phone&searchInfo.sqlvalue=1&searchInfo.type=like&showType=link&showpage=3'>尾页</a>
                                        </td>
                                    </tr>
                                    </table>
                                </td>-->
                            </tr>
                        </table>

                        </body>
                        </html></td></tr>
                </table>

                <br>
            </td>
        </tr>

    </table>
    <!-- 页脚 -->
    <iframe src="/view/end.html" frameBorder="0" width="920" scrolling="no" height="70" style="margin-top:0"></iframe>
</center>
</body>

<script>

    window.onload = function () {
        // 通过getElementById获取嵌套页面的ID调用嵌套的页面的方法进行参数回填
        document.getElementById("searchPage").contentWindow.optionBreak();
        searchInfo(1);
    };

    <!--    根据不同条件进行信息搜索-->
    function searchInfo(pN) {
        var searchType = window.localStorage.getItem("searchType");
        var type = window.localStorage.getItem("type");
        var key = window.localStorage.getItem("key");
        var size = 5;
        if (pN == null || pN == undefined || pN == '') {
            pN = 1;
        }
        $.ajax({
            url:'/info/search',
            type:'post',
            data:{
                pageNum:pN,
                pageSize:size,
                type:type,
                key:key,
                searchType:searchType
            },
            success:function (result) {
                build_result(result);
                build_page_info(result);
                build_page_nav(result);
            }
        });
    }

    // 解析并显示结果集
    function build_result(result) {
        $("#searchResult tbody").empty();
        var infos = result.extend.page.list;
        console.log(infos);
        $.each(infos, function (index, item) {
            var id = $("<td></td>").append(index + 1);
            var infoType = $("<td></td>").append(item.type.typeName);
            var infoId = $("<td></td>").append(item.id);
            var infoTitle = $("<td></td>").append(item.infoTitle);
            var infoDate = $("<td></td>").append(item.infoDate);
            var infoLinkman = $("<td></td>").append(item.infoLinkman);
            $("<tr></tr>").append(id)
                .append(infoType)
                .append(infoId)
                .append(infoTitle)
                .append(infoDate)
                .append(infoLinkman)
                .appendTo("#searchResult tbody");
        })
    }

</script>
</html>